export default class Utils {
    static getUserInfo(): any {
        try {
            let userInfo = localStorage.getItem('userInfo');
            return JSON.parse(userInfo);
        } catch (e) {
            return null;
        }
    }

    static isNull(...objs) {
        let bol = false, fn = (obj) => {
            if (typeof obj == 'undefined') {
                return true;
            } else if (obj == null) {
                return true;
            } else if (typeof obj == 'string' && (obj.trim() === '' || obj === 'undefined' || obj === 'null')) {
                return true;
            } else if (typeof obj == 'object' && Array.isArray(obj) && obj.length == 0) {
                return true;
            } else if (typeof obj == 'object' && !Array.isArray(obj) && Object.keys(obj).length == 0) {
                return true;
            } else {
                return false;
            }
        };
        bol = objs.some(obj => {
            return fn(obj);
        });
        return bol;
    }
}
